-
Notifications
You must be signed in to change notification settings - Fork 286
Fix non-tls forward-proxy #848
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
| } | ||
| } | ||
| if (self._request_secure and !self._proxy_secure) { | ||
| if (self._request_secure and !self._proxy_secure and !self._client.isForwardProxy()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the only real change.
| } | ||
| } | ||
| if (self._request_secure and !self._proxy_secure) { | ||
| if (self._request_secure and !self._proxy_secure and !self._client.isForwardProxy()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe we would need this to support a secure forward proxy (proxy_tls_config need to be put in scope)
| if (self._request_secure and !self._proxy_secure and !self._client.isForwardProxy()) { | |
| if (self._client.isForwardProxy()) { | |
| if (self._proxy_secure) { | |
| self._connection.?.tls = .{ | |
| .blocking = try tls.client(std.net.Stream{ .handle = socket }, proxy_tls_config), | |
| }; | |
| } | |
| } else if (self._request_secure and !self._proxy_secure) { // handles both insecure connect proxy and no proxy case | |
| self._connection.?.tls = .{ | |
| .blocking = try tls.client(std.net.Stream{ .handle = socket }, tls_config), | |
| }; | |
| } |
Starting to think the refactored version would have been better here anyway.
#815 (comment)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
now it's:
if (
(self._request_secure and !self._proxy_secure) and
(!self._client.isForwardProxy() or self._proxy_secure)
) {There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should the tls_config be changed to point to the right endpoint? if it is the tls for the proxy?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
or self._proxy_secure can never make the whole statement true since and !self._proxy_secure is also part of it
This reverts commit b6132f2.
Also renamed
isSimpleProxy->isForwardProxyfor consistent with the proxy type name.